import random
num=random.randint(1,100)

flag=True
count=0

while flag:
    guss_num=int(input("猜一个数字:"))
    count+=1

    if guss_num==num:
        print("对了")
        flag=False
    else:
        if guss_num>num:
            print('大了')
        else:
            print('小了')
print(f'猜了{count}次')